import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
// import Home from './../views/Home.vue'
// import Mine from '../views/Mine.vue'
// import Test1 from '../views/Test1.vue'
// import Error from '../views/Error.vue'
import Home from '../views/home/index.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Home
  }
















  // {
  //   path: '/home',
  //   //path: '/home/:age',     /:age 这种在地址中加参数名的方法 可以防止params传值刷新消失的问题
  //   name: 'home',
  //   component: Home,
  //   children: [
  //     {
  //       path: 'test1',
  //       component: Test1
  //     }
  //   ]
  // },
  // {
  //   path: '/mine',
  //   // path: '/mine/:name/:age',     方法三对应的路径
  //   component: Mine
  // },
  // {
  //   path:'/*',
  //   component: Error
  // }
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
